package com.itsu.vtalk.exception;

import com.itsu.vtalk.vo.RestEntity;

/**
 * @author suben
 * @createtime 2020/6/21 10:06
 **/
public class SystemBaseException extends Exception {

    private final String errorCode;

    private final String errorMsg;

    public SystemBaseException() {
        super();
        this.errorCode = RestEntity.DEFAULT_ERROR.getReturnCode();
        this.errorMsg = RestEntity.DEFAULT_ERROR.getReturnMsg();
    }

    public SystemBaseException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.errorMsg = message;
    }

    public SystemBaseException(String message) {
        super(message);
        this.errorCode = RestEntity.DEFAULT_ERROR.getReturnCode();
        this.errorMsg = message;
    }

    public SystemBaseException(String message, Throwable cause) {
        super(message, cause);
        this.errorCode = RestEntity.DEFAULT_ERROR.getReturnCode();
        this.errorMsg = message;
    }

    public SystemBaseException(String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.errorMsg = message;
    }

    public SystemBaseException(Throwable cause) {
        super(cause);
        this.errorCode = RestEntity.DEFAULT_ERROR.getReturnCode();
        this.errorMsg = RestEntity.DEFAULT_ERROR.getReturnMsg();
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
}
